cssvalue: Don't allow empty arrays anymore
authorBenjamin Otte <otte@redhat.com>
Wed, 29 Aug 2012 10:37:16 +0000 (12:37 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 3 Sep 2012 10:54:14 +0000 (12:54 +0200)
CSS arrays aren't empty, even the ones that appear empty contain one
"none" element.

gtk/gtkcssarrayvalue.c

index 6c3cb4eb4d94bddbd1b4caf1201e16e794845c63..fb22294c5cc873f66dff265ba64f83d3c9e384e6 100644 (file)
@@ -128,13 +128,10 @@ static const GtkCssValueClass GTK_CSS_VALUE_ARRAY = {
   gtk_css_value_array_print
 };
 
-static GtkCssValue none_singleton = { &GTK_CSS_VALUE_ARRAY, 1, 0, { NULL } };
-
 GtkCssValue *
 _gtk_css_array_value_new (GtkCssValue *content)
 {
-  if (content == NULL)
-    return _gtk_css_value_ref (&none_singleton);
+  g_return_val_if_fail (content != NULL, NULL);
 
   return _gtk_css_array_value_new_from_array (&content, 1);
 }